package com.eshop.controller;

import com.eshop.pojo.RespBean;
import com.eshop.pojo.User;
import com.eshop.service.RegisterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Api(tags = "注册相关")
@RestController
@RequestMapping("/register")
public class RegisterController {

    @Autowired
    RegisterService registerService;

    @ApiOperation(value = "用户注册")
    @PostMapping("/")
    public RespBean UserRegister(@RequestParam(defaultValue = "买家") String nameZh,User user){
        return registerService.UserRegister(user,nameZh);
    }

    @PostMapping("/hello")
    public String hello(){
        return "hello";
    }

}
